package com.nl.controller.xuyi.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Base64Utils;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.nl.controller.common.model.BaseResult;
import com.nl.controller.web.bean.BdResult;
import com.nl.controller.web.bean.SmsAllStation;
import com.nl.controller.web.bean.SmsBaseStation;
import com.nl.controller.web.bean.XuYiStation;
import com.nl.controller.web.mapper.SmsAreaMapper;
import com.nl.controller.web.service.SmsInterfacesService;
import com.nl.controller.web.util.FileUtil;
import com.nl.controller.web.util.HttpClientUtil;
import com.nl.controller.xuyi.mapper.XuYiPathMapper;

import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class XuYiPathService {
	@Autowired
	SmsInterfacesService smsInterfacesService;
	@Autowired
	XuYiPathMapper xuYiPathMapper;
	
	@Autowired
	SmsAreaMapper smsAreaMapper;

	public PageInfo<XuYiStation> findXuYiPathList(int page,int limit,String pathName) {
		PageHelper.startPage(page, limit);
		List<XuYiStation> xuYiPathList = new ArrayList<XuYiStation>();
		xuYiPathList= xuYiPathMapper.findXuYiPathList(pathName);
		PageInfo<XuYiStation> pageInfo = new PageInfo<XuYiStation>(xuYiPathList);
		return pageInfo;
	}


	public int deletePath(String pathName) {
		int result = 0;
		try {
			result = xuYiPathMapper.deletePath(pathName);
		} catch (Exception e) {
			log.info("删除路线信息发生异常");
			e.printStackTrace();
		}
		return result;
	}

}
